﻿<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
 <meta http-equiv="Content-Type" content="text/html" charset="UTF-8" >
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>烫烫博客管理</title>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<link rel="apple-touch-icon-precomposed" href="/img/icon/icon.png">
<link rel="Shortcut Icon" href="favicon.ico" type="image/ico">
<script src="js/jquery-2.1.4.min.js"></script>
<!--[if gte IE 9]>
  <script src="js/jquery-1.11.1.min.js" type="text/javascript"></script>
  <script src="js/html5shiv.min.js" type="text/javascript"></script>
  <script src="js/respond.min.js" type="text/javascript"></script>
  <script src="js/selectivizr-min.js" type="text/javascript"></script>
<![endif]-->
<!--[if lt IE 9]>
  <script>window.location.href='upgrade-browser.html';</script>
<![endif]-->
</head>

<body class="user-select">
<section class="container-fluid">
  <header>
    <nav class="navbar navbar-default navbar-fixed-top">
      <div class="container-fluid">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false"> <span class="sr-only">切换导航</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
          <a class="navbar-brand" href="/">烫烫</a> </div>
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
          <ul class="nav navbar-nav navbar-right">
            <li><a href="/logout" onClick="if(!confirm('是否确认退出？'))return false;">退出登录</a></li>
          </ul>
          <form action="" method="post" class="navbar-form navbar-right" role="search">
            <div class="input-group">
              <input type="text" class="form-control" autocomplete="off" placeholder="键入关键字搜索" maxlength="15">
              <span class="input-group-btn">
              <button class="btn btn-default" type="submit">搜索</button>
              </span> </div>
          </form>
        </div>
      </div>
    </nav>
  </header>
  <div class="row">
    <aside class="col-sm-3 col-md-2 col-lg-2 sidebar">
      <ul class="nav nav-sidebar">
        <li class="active"><a href="/adminindex.html">关于</a></li>
      </ul>
      <ul class="nav nav-sidebar">
        <li ><a href="/show-article.html">文章</a></li>
      </ul>
      <ul class="nav nav-sidebar">
        <li><a href="/category.html">分类</a></li>
      </ul>
      <ul class="nav nav-sidebar">
        <li><a href="/tag.html">标签</a></li>
      </ul><ul class="nav nav-sidebar">
      <li><a href="/link.html">友链</a></li>
    </ul>
    </aside>
    <div class="col-sm-9 col-sm-offset-3 col-md-10 col-lg-10 col-md-offset-2 main" id="main">
      <h1 class="page-header">信息总览</h1>
      <div class="row placeholders">
        <div class="col-xs-6 col-sm-3 placeholder">
          <h4>文章</h4>
          <span id="article" class="text-muted">-1 条</span> </div>
        <div class="col-xs-6 col-sm-3 placeholder">
          <h4>分类</h4>
          <span id="category" class="text-muted">-1 条</span> </div>
        <div class="col-xs-6 col-sm-3 placeholder">
          <h4>标签</h4>
          <span id="tag" class="text-muted">-1 条</span> </div>
        <div class="col-xs-6 col-sm-3 placeholder">
          <h4>友链</h4>
          <span id="link" class="text-muted">-1 条</span> </div>
          <div class="col-xs-6 col-sm-3 placeholder">
      </div>
      </div>
    </div>
  </div>
</section>

<script src="js/bootstrap.min.js"></script> 
<script src="js/admin-scripts.js"></script>
<script src="/js/public-method.js"></script>
<script>
    function countArticle() {
        $.ajax({
            url:"/article/count",
            data:{},
            dataTye:"json",
            type:"post",
            success:function (data) {
                $("#article").text(data+"条")
            }
        })
    }
    function countTag() {
        $.ajax({
            url:"/tag/count",
            data:{},
            dataTye:"json",
            type:"post",
            success:function (data) {
                $("#tag").text(data+"条")
            }
        })
    }
    function countCategory() {
        $.ajax({
            url:"/category/count",
            data:{},
            dataTye:"json",
            type:"post",
            success:function (data) {
                $("#category").text(data+"条")
            }
        })
    }

    function countLink() {
        $.ajax({
            url:"/link/count",
            data:{},
            dataTye:"json",
            type:"post",
            success:function (data) {
                $("#link").text(data+"条")
            }
        })
    }

    $(document).ready(function () {
        countArticle();
        countCategory();
        countTag();
        countLink();
    })
</script>
</body>
</html>
